const Mock = require('mockjs')
var { successData, errorData } = require('../serverData')
var MockRandom = Mock.Random;
const role = (req, res) => {
    var currPage = req.query.currPage || 1;
    let bookListTemplate = {
        'totalPage': 1,
        'currPage':currPage,
        'list':[
            {
                id: 1,
                name: '超级管理员',
                menu: [1, 2, 3, 5, 51, 52, 53, 531, 532],
                remarks: ' @cparagraph(2)',
                createTime: '@datetime()'
            },
            {
                id: 2,
                name: '一级管理员',
                menu: [1, 2, 3, 5, 51],
                remarks: ' @cparagraph(2)',
                createTime: '@datetime()'
            },
            {
                id: 3,
                name: '二级管理员',
                remarks: ' @cparagraph(2)',
                menu: [1, 2, 3],
                createTime: '@datetime()'
            },
        ]
    }
    var mockData = Mock.mock(bookListTemplate);
    successData.data = mockData
    res.end(JSON.stringify(successData));
}

module.exports = role